package com.banach.prema.service;

import com.banach.prema.dto.cmd.SosCmd;
import com.banach.prema.dto.query.SosPageQuery;
import com.banach.prema.dto.vo.SosVO;
import com.banach.prema.executor.SosEndExe;
import com.banach.prema.executor.SosQueryExe;
import com.banach.prema.executor.SosSendExe;
import com.ego.base.dto.vo.AddressVO;
import com.ego.framework.annotation.ReqParam;
import com.ego.framework.dto.Response;
import com.ego.framework.model.CustomizePage;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author ajun
 * @Desc
 * @Date 2025/3/24 11:33
 */
@Service
public class SosService {

    @Resource
    private SosQueryExe sosQueryExe;
    @Resource
    private SosSendExe sosSendExe;
    @Resource
    private SosEndExe sosEndExe;
    public ModelAndView getViewById(HttpServletRequest request,Long sosId) {
        return sosQueryExe.getViewById(request,sosId);
    }

    public Response<AddressVO> getCurrentLocation(Long sosId) {
        return sosQueryExe.getCurrentLocation(sosId);
    }

    public Response send(SosCmd sosCmd) {
        return sosSendExe.send(sosCmd);
    }

    public Response end(Long sosId) {
        return sosEndExe.end(sosId);
    }

    public Response<CustomizePage<SosVO>> selectPage(SosPageQuery pageQuery) {
        return sosQueryExe.selectPage(pageQuery);
    }

    public Response<CustomizePage<SosVO>> selectMyPage(){
        return sosQueryExe.selectMyPage();
    }
}
